package C.e.io;

import java.io.FileOutputStream;
import java.io.IOException;
import java.nio.charset.StandardCharsets;

/**
 * 向文件中写入文本数据
 */
public class WriteStringDemo {
    public static void main(String[] args) throws IOException {
        /*FileOutputStream fos=new FileOutputStream("D://ddb/.txt",true);
        String line="我囸你的哥";
        byte[]data=line.getBytes(StandardCharsets.UTF_8);
        fos.write(data);
        fos.write("哈皮玩意".getBytes(StandardCharsets.UTF_8));
        System.out.println("完事了");
        fos.close();*/
        FileOutputStream fos = new FileOutputStream("q.txt",true);
        String line = "心你";
        byte[] data = line.getBytes(StandardCharsets.UTF_8);
        fos.write(data);
        fos.write("爱".getBytes(StandardCharsets.UTF_8));
        System.out.println("写完!");
        fos.close();
    }
}
